use crate::client::connection_pool::PoolError;
use thiserror::Error;

#[derive(Error, Debug)]
pub enum GrpcClientError {
    #[error("Broken pipe error: {0}")]
    BrokenPipe(String),
    #[error("Connection error: {0}")]
    Connection(String),
    #[error("All connections failed")]
    AllConnectionsFailed,
    #[error("Service unavailable")]
    ServiceUnavailable,
    #[error("Timeout error: {0}")]
    Timeout(String),
    #[error("Retry limit exceeded: {0}")]
    RetryLimitExceeded(String),
    #[error("gRPC status error: {0}")]
    Status(#[from] tonic::Status),
    #[error("Transport error: {0}")]
    Transport(#[from] tonic::transport::Error),
    #[error("Pool error: {0}")]
    Pool(#[from] PoolError),
}
